import request from '@/utils/request'

const api_name = '/product/category'

export default {
  getDataList() {
    return request({
      url: `${api_name}/treelist`,
        method: 'get'
    })
  },
    
    deleteCategory(id) {
      return request({
        url:`${api_name}/delete/${id}`,
        method:'delete'
      })
    },
    
    getCategory(data) {
      return request({
        url:`${api_name}/info`,
        method: 'get',
        params: data
      })
    },
      
    createCategory(data) {
      return request({
        url:`${api_name}/create`,
        method: 'post',
        data: data
      })
    },
      
    updateCategory(data) {
      return request({
        url:`${api_name}/update`,
        method: 'post',
        data: data
      })
    }

}

